/**
 * Copyright (C), 2019-2022, 宇信融汇
 * FileName: CollectionDemo
 * Author:   666
 * Date:     2022/1/16 23:08
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package com.collectiondemo;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * @Classname CollectionDemo
 * @Description TODO
 * @Date 2022/1/16 23:08
 * @Created by 666
 */
public class CollectionDemo {
    public static void main(String[] args) {
//        List<String> ll = new LinkedList<>();
//        LinkedList ll1 = new LinkedList<>();
//        ll1.add();


        ArrayList<String> arrs = new ArrayList<>();
        arrs.add("张三");
        arrs.add("李四");
        arrs.add("abc");
        arrs.add("李四");
        arrs.add("王五");
        //A、 迭代器进行删除数据
        Iterator<String> iterator = arrs.iterator();
        while (iterator.hasNext()) {
            String arr = iterator.next();
            if ("李四".equals(arr)) {
                iterator.remove();
            }
        }
        System.out.println(arrs);
    }
}
